package com.zjmzxfzhl.modules.purchase.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.zjmzxfzhl.modules.purchase.controller.dto.PurchaseOrderDetailDto;
import com.zjmzxfzhl.modules.purchase.controller.vo.PurchaseOrderDetailVo;
import com.zjmzxfzhl.modules.purchase.entity.PurchaseOrderDetail;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Property;
import org.springframework.web.bind.annotation.PutMapping;

import java.util.List;

/**
 * Mapper
 *
 * @author 庄金明
 */
public interface PurchaseOrderDetailMapper extends BaseMapper<PurchaseOrderDetail> {
    /**
     * 查询列表
     *
     * @param page
     * @param entity
     * @return
     */
    List<PurchaseOrderDetail> list(IPage<PurchaseOrderDetail> page, @Param("entity") PurchaseOrderDetail entity);

    /**
     * 筛选查询清单信息
     * @param entity
     * @return
     */
    List<PurchaseOrderDetailVo> listDetailBy(@Param("entity") PurchaseOrderDetailDto entity);

    /**
     * 删除审批单清单信息
     * @param orderId
     */
    void deleteByOrderId(@Param("orderId") Long orderId);

    /**
     * 查询物料在其他审批单中使用情况
     * @param materialId
     * @param orderId
     * @return
     */
    List<PurchaseOrderDetail> listMaterialNotInOrder(@Param("materialId") Long materialId, @Param("orderId") Long orderId);
}
